package com.kystar.muxplayer.protocol.code.set;

import android.util.Size;
import com.kystar.muxplayer.protocol.CodeCmd;

public class CS05_ScreenSize extends CodeCmd {
    private CS05_ScreenSize(int[] par) {
        super(par);
    }

    @Override
    public byte getCode() {
        return 0x05;
    }


    public static CS05_ScreenSize create(Size[] sizes) {
        int len = sizes.length;
        int[] params= new  int[len*4+1];
        params[0] = len;
        for (int i = 0,k=1; i < len; i++) {
            params[k++] = sizes[i].getWidth()>>8;
            params[k++] = sizes[i].getWidth();
            params[k++] = sizes[i].getHeight()>>8;
            params[k++] = sizes[i].getHeight();
        }
        return new CS05_ScreenSize(params);
    }
}
